package homework5

object Common {

  /**
   * 开始消息
   * @param msg
   */
  case class StartMessage(msg: String)

  /**
   * 注册信息
   * @param id
   * @param cpu
   * @param ram
   */
  case class RegisterWorkInfo(id: String, cpu: Int, ram: Int)

  /**
   * 封装worker信息
   * @param id
   * @param cpu
   * @param ram
   */
  class WorkInfo(var id: String, cpu: Int, ram: Int){
    var lasterHeartBeatTime = System.currentTimeMillis()
  }

  /**
   * 注册成功返回信息
   */
  case object RegisteredWorkerInfo

  /**
   * 发送心跳对象
   */
  case object SendHeartBeat

  /**
   * 心跳消息
   * @param id
   */
  case class HeartBeat(id: String)

  /**
   * 心跳检测，开始时间监测
   */
  case object StartTimeoutCheck

  /**
   * 移除过时的worker
   */
  case object RemoveTimeoutWorker
}
